
#include <iostream>

using namespace std;

class Sql
{
public:
    virtual void insert_data(int num) = 0;
};

class Mysql : public Sql
{
public:
    void insert_data(int num)
    {
        cout << "insert num mysql!" << endl;
    }
};

class Sqlite3 : public Sql
{
public:
    void insert_data(int num)
    {
        cout << "insert num sqlite3!" << endl;
    }
};

class DB : public Sql
{
public:
    void insert_data(int num)
    {
        cout << "insert num DB!" << endl;
    }
};

class SoftWare  //
{
public:
    SoftWare(Sql &sql) : m_sql(sql)
    {

    }
    void insert(int num)
    {
        m_sql.insert_data(num);
    }

    Sql &m_sql;
};

int main()
{
    Mysql mysql;
    Sqlite3 sqlite3;
    DB db;
    SoftWare s(db);
    s.insert(10000);
}